<?php
class Default_View_Filter_CheckEmployee 
{
	private $_error;
	private $_messagesError;
	public function __construct($data)
	{
		$validator = new Zend_Validate_StringLength(3,32);
		if (!$validator->isValid($data['employee_name']))	
		{
			$this->_messagesError[]="Employee Name: ".current($validator->getMessages())." or not blank";
		}
		
		$validator = new Zend_Validate_EmailAddress();
		if (!$validator->isValid($data['employee_email'])&&!empty($data['customer_email']))	
		{
			$this->_messagesError[]="Email Address: ".current($validator->getMessages())." or not blank";
		}
		
		$this->_error = count($this->_messagesError)==0?true:false;	
	}
	public function isValid()
	{
		return $this->_error;
	}
	public function getMessages()
	{
		return $this->_messagesError;
	}
}

